package tds.model20.version1;
/**
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName Leaf
 * @Description 叶子节点，没有子节点
 * @author tds
 * @Date 2020/2/5 17:28
 * @version 1.0.0
 */
public class Leaf extends Component {

    public Leaf(String name) {
        super(name);
    }

    @Override
    public void add(Component component) {
        System.out.println("leaf can not add");
    }

    @Override
    public void remove(Component component) {
        System.out.println("leaf can not remove");
    }

    @Override
    public void display() {
        System.out.println("我是叶子节点：" + name);
    }
}
